package org.jianfa.learn;

import org.springframework.core.convert.converter.Converter;

public class StringToCarConverter implements Converter<String, Car> {

    @Override
    public Car convert(String text) {
        String[] texts = text.split(";");
        Car car = new Car();
        car.setBrand(texts[0]);
        car.setColor(texts[1]);
        return car;
    }
}
